package com.hdu.dwh.service.impl.cube_impl;

import java.util.Set;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hdu.dwh.mapper.cube_mapper.CubeMetricMapper;
import com.hdu.dwh.pojos.cube_pojos.CubeMetric;
import com.hdu.dwh.service.cube_service.CubeMetricService;

@Service
public class CubeMetricServiceImpl extends ServiceImpl<CubeMetricMapper, CubeMetric> implements CubeMetricService {

    @Override
    public Set<CubeMetric> getMetricsByCubeId(Integer id) {
        return this.lambdaQuery().eq(CubeMetric::getCubeId, id).list().stream().collect(java.util.stream.Collectors.toSet());
    }

    @Override
    public void removeByCubeId(Integer id) {
        this.lambdaUpdate().eq(CubeMetric::getCubeId, id).remove();
    }
    
}
